﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ECS_Test
{
    class Sys_Movement : System
    {
        public Sys_Movement(CompTypes[] requiredComponentTypes)
            : base(requiredComponentTypes)
        {

        }
        public override void Update()
        {
            foreach (int _e in entities)
            {
                Comp_Position pos = (Comp_Position)GameState.em.allEntities[_e].comps[CompTypes.Position];
                Comp_Velocity vel = (Comp_Velocity)GameState.em.allEntities[_e].comps[CompTypes.Velocity];

                pos.x += vel.x;
                pos.y += vel.y;
                pos.z += vel.z;

                GameState.em.allEntities[_e].comps[CompTypes.Position] = pos;
            }
        }
    }
}
